import Http from "../http";

export const queryScenesApi = function() {
    return Http.get('/api/scene/list')
}

export const querySceneDetailApi = function(params: any) {
    return Http.post('/api/scene/detail', params)
}

export const querySQLParserApi = function (params: any) {
    return Http.post('api/scene/sql_progress', params)
}

export const deleteSceneApi = function(params: any) {
    return Http.get('/api/scene/delete', params)
}

export const addSceneApi = function(data: any) {
    return Http.post('/api/scene/add', data)
}

export const addSceneSQLApi = function(data: any) {
    return Http.post('/api/scene/add_by_sql', data, { headers: { 'Content-Type': 'application/multipart/form-data' }})
}

export const updateSceneApi = function(data: any) {
    return Http.post('/api/scene/update', data)
}

export const executeSceneApi = function(data: any) {
    return Http.post('/api/scene/execute', data)
}

export const queryProgress = function(data: any) {
    return Http.get('/api/scene/progress', data)
}

export const queryInsertSqlProgress = function(data: any) {
    return Http.get('/api/scene/insert_progress', data)
}

export const insertDataApi = function(data: any) {
    return Http.post('/api/scene/run_insert', data)
}

export const queryRecordApi = function(data: any) {
    return Http.get('/api/scene/record', data)
}

export const queryRecordCountApi = function(data: any) {
    return Http.post('/api/scene/record_count', data)
}

export const viewRecordSqlApi = function(data: any) {
    return Http.get('/api/scene/record_sql', data)
}

export const viewRecordSqlCountApi = function(data: any) {
    return Http.post('/api/scene/record_sql_count', data)
}

export const reviewDataAPi = function(data: any) {
    return Http.get('/api/scene/view_insert_data', data)
}


export const queryRowDataApi = function(data: any) {
    return Http.get('/api/scene/row_data', data)
}

export const downLoadSqlData = function(data: any) {
    return Http.get('/api/scene/download_sql', data, {responseType: 'blob'})
}

export const updateDataApi = function(data: any) {
    return Http.post('/api/scene/update_insert_data', data)
}

export const getTableTreeApi = function(data: any) {
    return Http.post('/api/scene/table_to_tree', data)
}

export const querySceneList = function(data: any) {
    return Http.get('/api/scene/list_detail', data)
}

export const getSceneColumnApi = function(data: any) {
    return Http.post('/api/scene/get_scene_column', data)
}

export const addSceneOfCopyApi = function(data: any) {
    return Http.post('/api/scene/copy', data)
}

export const queryRuleHistoryApi = function() {
    return Http.get('/api/scene/query_rule_history')
}

export const setRuleHistoryApi = function(data: any) {
    return Http.post('/api/scene/set_rule_history', data)
}